<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">

		<title>购物车页面</title>

		<link href="/Public/one/AmazeUI-2.4.2/assets/css/amazeui.css" rel="stylesheet" type="text/css" />
		<link href="/Public/one/basic/css/demo.css" rel="stylesheet" type="text/css" />
		<link href="/Public/one/css/cartstyle.css" rel="stylesheet" type="text/css" />
		<link href="/Public/one/css/optstyle.css" rel="stylesheet" type="text/css" />

		<script type="text/javascript" src="/Public/one/js/jquery.js"></script>


	</head>

	<body>

		<!--顶部导航条 -->
		<include file="Public/tpl/hometop.html"/>
			<!--购物车 -->
			<div class="concent">
				<div id="cartTable">
					<div class="cart-table-th">
						<div class="wp">
							<div class="th th-chk">
								<div id="J_SelectAll1" class="select-all J_SelectAll">

								</div>
							</div>
							<div class="th th-item">
								<div class="td-inner">商品信息</div>
							</div>
							<div class="th th-price">
								<div class="td-inner">单价</div>
							</div>
							<div class="th th-amount">
								<div class="td-inner">数量</div>
							</div>
							<div class="th th-sum">
								<div class="td-inner">金额</div>
							</div>
							<div class="th th-op">
								<div class="td-inner">操作</div>
							</div>
						</div>
					</div>
					<div class="clear"></div>

					<tr class="item-list">
						<div class="bundle  bundle-last ">
							<div class="bundle-hd">
								<div class="bd-promos">
									<div class="bd-has-promo">已享优惠:<span class="bd-has-promo-content">省￥19.50</span>&nbsp;&nbsp;</div>
									<div class="act-promo">
										<a href="#" target="_blank">第二支半价，第三支免费<span class="gt">&gt;&gt;</span></a>
									</div>
									<span class="list-change theme-login">编辑</span>
								</div>
							</div>
							<div class="clear"></div>
							<div class="bundle-main">
							<volist name="data" id="val" key="k" >
								<div class="item12">
								<ul class="item-content clearfix">
									<li class="td td-chk">
										<div class="cart-checkbox ">
											<input class="check" id="J_CheckBox_170037950254" name="items[]" value="170037950254" type="checkbox" alt="{$val.id}">
											<label for="J_CheckBox_170037950254"></label>
										</div>
									</li>
									<li class="td td-item">
										<div class="item-pic">
											<a href="#" target="_blank" data-title="{$val.name}" class="J_MakePoint" data-point="tbcart.8.12">
												<img src="{$val.images}" class="itempic J_ItemImg" style="width:80px;height:80px"></a>
										</div>
										<div class="item-info">
											<div class="item-basic-info">
												<a href="#" target="_blank" title="{$val.name}" class="item-title J_MakePoint" data-point="tbcart.8.11">{$val.name}</a>
											</div>
										</div>
									</li>
									<li class="td td-info">
										<div class="item-props item-props-can">
										<volist name="val.property" id="property">
											<span class="sku-line">{$property}</span>&nbsp;&nbsp;
										</volist>
											<!-- <span class="sku-line">包装：裸装</span> -->
											<span tabindex="0" class="btn-edit-sku theme-login">修改</span>
											<i class="theme-login am-icon-sort-desc"></i>
										</div>
									</li>
									<li class="td td-price">
										<div class="item-price price-promo-promo">
											<div class="price-content">
												<div class="price-line">
													<em class="price-original">{$val.originprice}</em>
												</div>
												<div class="price-line">
													<em class="J_Price price-now" tabindex="0" id="price{$k}">
													{$val.price}</em>
												</div>
											</div>
										</div>
									</li>
									<li class="td td-amount">
										<div class="amount-wrapper ">
											<div class="item-amount ">
												<div class="sl">
													<input class="min am-btn" name="" type="button" value="-" onclick="reduce(this)" alt="{$val.id}"/>
													<input class="text_box" name="" type="text" value="{$val.count}" style="width:30px;" />
													<input class="add am-btn" name="" type="button" value="+" onclick="add(this)" alt="{$val.id}"/>
												</div>
											</div>
										</div>
									</li>
									<li class="td td-sum">
										<div class="td-inner">
											<em tabindex="0" class="J_ItemSum number">117.00</em>
										</div>
									</li>
									<li class="td td-op">
										<div class="td-inner">
											<a title="移入收藏夹" class="btn-fav" href="#">
                  							移入收藏夹</a>
											<a href="#" data-point-url="#" class="delete" alt="{$val.id}" onclick="deleteproduct(this)">
                 							 删除</a>
										</div>
									</li>
								</ul>
							</div>		
							</volist>		
							
								
								<!-- <ul class="item-content clearfix">
									<li class="td td-chk">
										<div class="cart-checkbox ">
											<input class="check" id="J_CheckBox_170037950254" name="items[]" value="170037950254" type="checkbox">
											<label for="J_CheckBox_170037950254"></label>
										</div>
									</li>
									<li class="td td-item">
										<div class="item-pic">
											<a href="#" target="_blank" data-title="美康粉黛醉美东方唇膏口红正品 持久保湿滋润防水不掉色护唇彩妆" class="J_MakePoint" data-point="tbcart.8.12">
												<img src="/Public/one/images/kouhong.jpg_80x80.jpg" class="itempic J_ItemImg"></a>
										</div>
										<div class="item-info">
											<div class="item-basic-info">
												<a href="#" target="_blank" title="美康粉黛醉美唇膏 持久保湿滋润防水不掉色" class="item-title J_MakePoint" data-point="tbcart.8.11">美康粉黛醉美唇膏 持久保湿滋润防水不掉色</a>
											</div>
										</div>
									</li>
									<li class="td td-info">
										<div class="item-props item-props-can">
											<span class="sku-line">颜色：12#川南玛瑙</span>
											<span class="sku-line">包装：裸装</span>
											<span tabindex="0" class="btn-edit-sku theme-login">修改</span>
											<i class="theme-login am-icon-sort-desc"></i>
										</div>
									</li>
									<li class="td td-price">
										<div class="item-price price-promo-promo">
											<div class="price-content">
												<div class="price-line">
													<em class="price-original">78.00</em>
												</div>
												<div class="price-line">
													<em class="J_Price price-now" tabindex="0">39.00</em>
												</div>
											</div>
										</div>
									</li>
									<li class="td td-amount">
										<div class="amount-wrapper ">
											<div class="item-amount ">
												<div class="sl">
													<input class="min am-btn" name="" type="button" value="-" />
													<input class="text_box" name="" type="text" value="3" style="width:30px;" />
													<input class="add am-btn" name="" type="button" value="+" />
												</div>
											</div>
										</div>
									</li>
									<li class="td td-sum">
										<div class="td-inner">
											<em tabindex="0" class="J_ItemSum number">117.00</em>
										</div>
									</li>
									<li class="td td-op">
										<div class="td-inner">
											<a title="移入收藏夹" class="btn-fav" href="#">
                  移入收藏夹</a>
											<a href="javascript:;" data-point-url="#" class="delete">
                  删除</a>
										</div>
									</li>
								</ul>
													
								
								
								
							</div>
						</div>
					</tr>
					<div class="clear"></div>

					<tr class="item-list">
						<div class="bundle  bundle-last ">
							<div class="bundle-hd">
								<div class="bd-promos">
									<div class="bd-has-promo">已享优惠:<span class="bd-has-promo-content">省￥19.50</span>&nbsp;&nbsp;</div>
									<div class="act-promo">
										<a href="#" target="_blank">第二支半价，第三支免费<span class="gt">&gt;&gt;</span></a>
									</div>
									<span class="list-change theme-login">编辑</span>
								</div>
							</div>
							<div class="clear"></div>
							<div class="bundle-main">
								<ul class="item-content clearfix">
									<li class="td td-chk">
										<div class="cart-checkbox ">
											<input class="check" id="J_CheckBox_170769542747" name="items[]" value="170769542747" type="checkbox">
											<label for="J_CheckBox_170769542747"></label>
										</div>
									</li>
									<li class="td td-item">
										<div class="item-pic">
											<a href="#" target="_blank" data-title="美康粉黛醉美东方唇膏口红正品 持久保湿滋润防水不掉色护唇彩妆" class="J_MakePoint" data-point="tbcart.8.12">
												<img src="/Public/one/images/kouhong.jpg_80x80.jpg" class="itempic J_ItemImg"></a>
										</div>
										<div class="item-info">
											<div class="item-basic-info">
												<a href="#" target="_blank" title="美康粉黛醉美唇膏 持久保湿滋润防水不掉色" class="item-title J_MakePoint" data-point="tbcart.8.11">美康粉黛醉美唇膏 持久保湿滋润防水不掉色</a>
											</div>
										</div>
									</li>
									<li class="td td-info">
										<div class="item-props item-props-can">
											<span class="sku-line">颜色：10#蜜橘色</span>
											<span class="sku-line">包装：两支手袋装（送彩带）</span>
											<span tabindex="0" class="btn-edit-sku theme-login">修改</span>
											<i class="theme-login am-icon-sort-desc"></i>
										</div>
									</li>
									<li class="td td-price">
										<div class="item-price price-promo-promo">
											<div class="price-content">
												<div class="price-line">
													<em class="price-original">78.00</em>
												</div>
												<div class="price-line">
													<em class="J_Price price-now" tabindex="0">39.00</em>
												</div>
											</div>
										</div>
									</li>
									<li class="td td-amount">
										<div class="amount-wrapper ">
											<div class="item-amount ">
												<div class="sl">
													<input class="min am-btn" name="" type="button" value="-" />
													<input class="text_box" name="" type="text" value="3" style="width:30px;" />
													<input class="add am-btn" name="" type="button" value="+" />
												</div>
											</div>
										</div>
									</li>
									<li class="td td-sum">
										<div class="td-inner">
											<em tabindex="0" class="J_ItemSum number">117.00</em>
										</div>
									</li>
									<li class="td td-op">
										<div class="td-inner">
											<a title="移入收藏夹" class="btn-fav" href="#">
                  移入收藏夹</a>
											<a href="javascript:;" data-point-url="#" class="delete">
                  删除</a>
										</div>
									</li>
								</ul> -->
							</div>
						</div>
					</tr>
				</div>
				<div class="clear"></div>

				<div class="float-bar-wrapper">
					<div id="J_SelectAll2" class="select-all J_SelectAll">
						<div class="cart-checkbox">
							<input class="check-all check" id="J_SelectAllCbx2" name="select-all" value="true" type="checkbox">
							<label for="J_SelectAllCbx2"></label>
						</div>
						<span>全选</span>
					</div>
					<div class="operations">
						<a href="#" hidefocus="true" class="deleteAll">删除</a>
						<a href="#" hidefocus="true" class="J_BatchFav">移入收藏夹</a>
					</div>
					<div class="float-bar-right">
						<div class="amount-sum">
							<span class="txt">已选商品</span>
							<em id="J_SelectedItemsCount">0</em><span class="txt">件</span>
							<div class="arrow-box">
								<span class="selected-items-arrow"></span>
								<span class="arrow"></span>
							</div>
						</div>
						<div class="price-sum">
							<span class="txt">合计:</span>
							<strong class="price">¥<em id="J_Total">0.00</em></strong>
						</div>
						<div class="btn-area">
							<a  id="J_Go" class="submit-btn submit-btn-disabled" aria-label="请注意如果没有选择宝贝，将无法结算">
								<span>结&nbsp;算</span></a>
						</div>
					</div>

				</div>

				<div class="footer">
					<div class="footer-hd">
						<p>
							<a href="#">恒望科技</a>
							<b>|</b>
							<a href="#">商城首页</a>
							<b>|</b>
							<a href="#">支付宝</a>
							<b>|</b>
							<a href="#">物流</a>
						</p>
					</div>
					<div class="footer-bd">
						<p>
							<a href="#">关于恒望</a>
							<a href="#">合作伙伴</a>
							<a href="#">联系我们</a>
							<a href="#">网站地图</a>
							<em>© 2015-2025 Hengwang.com 版权所有</em>
						</p>
					</div>
				</div>

			</div>

			<!--操作页面-->

			<div class="theme-popover-mask"></div>

			<div class="theme-popover">
				<div class="theme-span"></div>
				<div class="theme-poptit h-title">
					<a href="javascript:;" title="关闭" class="close">×</a>
				</div>
				<div class="theme-popbod dform">
					<form class="theme-signin" name="loginform" action="" method="post">

						<div class="theme-signin-left">

							<li class="theme-options">
								<div class="cart-title">颜色：</div>
								<ul>
									<li class="sku-line selected">12#川南玛瑙<i></i></li>
									<li class="sku-line">10#蜜橘色+17#樱花粉<i></i></li>
								</ul>
							</li>
							<li class="theme-options">
								<div class="cart-title">包装：</div>
								<ul>
									<li class="sku-line selected">包装：裸装<i></i></li>
									<li class="sku-line">两支手袋装（送彩带）<i></i></li>
								</ul>
							</li>
							<div class="theme-options">
								<div class="cart-title number">数量</div>
								<dd>
									<input class="min am-btn am-btn-default" name="" type="button" value="-" />
									<input class="text_box" name="" type="text" value="1" style="width:30px;" />
									<input class="add am-btn am-btn-default" name="" type="button" value="+" />
									<span  class="tb-hidden">库存<span class="stock">1000</span>件</span>
								</dd>

							</div>
							<div class="clear"></div>
							<div class="btn-op">
								<div class="btn am-btn am-btn-warning">确认</div>
								<div class="btn close am-btn am-btn-warning">取消</div>
							</div>

						</div>
						<div class="theme-signin-right">
							<div class="img-info">
								<img src="/Public/one/images/kouhong.jpg_80x80.jpg" />
							</div>
							<div class="text-info">
								<span class="J_Price price-now">¥39.00</span>
								<span id="Stock" class="tb-hidden">库存<span class="stock">1000</span>件</span>
							</div>
						</div>

					</form>
				</div>
			</div>
		<!--引导 -->
		<div class="navCir">
			<li><a href="home.html"><i class="am-icon-home "></i>首页</a></li>
			<li><a href="sort.html"><i class="am-icon-list"></i>分类</a></li>
			<li class="active"><a href="shopcart.html"><i class="am-icon-shopping-basket"></i>购物车</a></li>	
			<li><a href="/Public/one/person/index.html"><i class="am-icon-user"></i>我的</a></li>					
		</div>
		<!-- 购物车商品信息输出 -->
		<script type="text/html" id="productpush">
		 <%for(var i=0;i<data.length;i++){%>

			<div class="item12">
								<ul class="item-content clearfix">
									<li class="td td-chk">
										<div class="cart-checkbox ">
											<input class="check" id="J_CheckBox_170037950254" name="items[]" value="170037950254" type="checkbox" alt="<%=data[i].id%>">
											<label for="J_CheckBox_170037950254"></label>
										</div>
									</li>
									<li class="td td-item">
										<div class="item-pic">
											<a href="#" target="_blank" data-title="<%=data[i].name%>" class="J_MakePoint" data-point="tbcart.8.12">
												<img src="<%=data[i].images%>" class="itempic J_ItemImg" style="width:80px;height:80px"></a>
										</div>
										<div class="item-info">
											<div class="item-basic-info">
												<a href="#" target="_blank" title="<%=data[i].name%>" class="item-title J_MakePoint" data-point="tbcart.8.11"><%=data[i].name%></a>
											</div>
										</div>
									</li>
									<li class="td td-info">
										<div class="item-props item-props-can">
										<%var property=data[i].property%>
										<%for(var j=0;j<property.length;j++){%>
											<span class="sku-line"><%=property[j]%></span>&nbsp;&nbsp;
										<%}%>
											<!-- <span class="sku-line">包装：裸装</span> -->
											<span tabindex="0" class="btn-edit-sku theme-login">修改</span>
											<i class="theme-login am-icon-sort-desc"></i>
										</div>
									</li>
									<li class="td td-price">
										<div class="item-price price-promo-promo">
											<div class="price-content">
												<div class="price-line">
													<em class="price-original"><%=data[i].originprice%></em>
												</div>
												<div class="price-line">
													<em class="J_Price price-now" tabindex="0" id="price{$k}">
													<%=data[i].price%></em>
												</div>
											</div>
										</div>
									</li>
									<li class="td td-amount">
										<div class="amount-wrapper ">
											<div class="item-amount ">
												<div class="sl">
													<input class="min am-btn" name="" type="button" value="-" onclick="reduce(this)" alt="{$val.id}"/>
													<input class="text_box" name="" type="text" value="{$val.count}" style="width:30px;" />
													<input class="add am-btn" name="" type="button" value="+" onclick="add(this)" alt="{$val.id}"/>
												</div>
											</div>
										</div>
									</li>
									<li class="td td-sum">
										<div class="td-inner">
											<em tabindex="0" class="J_ItemSum number">117.00</em>
										</div>
									</li>
									<li class="td td-op">
										<div class="td-inner">
											<a title="移入收藏夹" class="btn-fav" href="#">
                  							移入收藏夹</a>
											<a href="#" data-point-url="#" class="delete" alt="{$val.id}" onclick="deleteproduct(this)">
                 							 删除</a>
										</div>
									</li>
								</ul>
							</div>		

			<%}%>

		</script>
		<script type="text/javascript" src="/Public/js/template-native.js"></script>
		<script type="text/javascript" src="/Public/js/showproperty.js"></script>
		<script type="text/javascript">
		function add(obj){		//点击增加商品数
			var price=$(obj).closest('.item12').find('.price-now').html();	
			var count=$(obj).prev().val();
			var priceCount=parseFloat(price)*(parseInt(count)+1);
			$(obj).closest('.item12').find('.J_ItemSum').html('');
			$(obj).closest('.item12').find('.J_ItemSum').html(priceCount.toFixed(2));
			
			//修改数据库的商品数量
			var addCount=parseInt(count)+1;
			var id=$(obj).attr('alt');
			$.post('/Api/Index/countChange',{'count':addCount,'id':id},function(ret){

			})
			selectTotalPrice();
			//selectTotalCount();
			if ($(obj).closest('.item12').find('.check').prop('checked')) {selectTotalCount();}
			
			
		}
		function reduce(obj){  //点击减少商品数
			var price=$(obj).closest('.item12').find('.price-now').html();
			var count=$(obj).next().val();
			
			//当商品数量为1时
			var a=true;
			if (count==1) {
				a=false;
				count=2;
			}
			
			var priceCount=parseFloat(price)*(parseInt(count)-1);
			$(obj).closest('.item12').find('.J_ItemSum').html('');
			$(obj).closest('.item12').find('.J_ItemSum').html(priceCount.toFixed(2));
			
			//修改数据库的商品数量
			var reduceCount=parseInt(count)-1;
			var id=$(obj).attr('alt');
			$.post('/Api/Index/countChange',{'count':reduceCount,'id':id},function(ret){

			})
			selectTotalPrice();
			//selectTotalCount1();
			if ($(obj).closest('.item12').find('.check').prop('checked')) {
				if (a==true) {
					selectTotalCount1();
				}
				
			}
		}
		function totalprice(){      //计算总价的
			var totalprice=0;
			$('.item12').find('.J_ItemSum').each(function(){
				if ($(this).closest('.item12').find('.check').prop('checked')) {
					var priceSingel=$(this).html();
					priceSingel=parseFloat(priceSingel);
					totalprice += priceSingel;
				}
			})
			$('#J_Total').html('');
			$('#J_Total').html(totalprice.toFixed(2));
		}
		function totalcount(){  //增加的时候计算总数
			var totalCount=0;
			$('.item12').find('.text_box').each(function(){
				if ($(this).closest('.item12').find('.check').prop('checked')) {
					var countProduct=$(this).val();
					countProduct=parseInt(countProduct);
					totalCount += countProduct;
				}
			})
			totalCount = totalCount +1;
			$('#J_SelectedItemsCount').html('');
			$('#J_SelectedItemsCount').html(totalCount);

		}
		function totalcount1(){  //减少的时候计算总数
			var totalCount=0;
			$('.item12').find('.text_box').each(function(){
				if ($(this).closest('.item12').find('.check').prop('checked')) {
					var countProduct=$(this).val();
					countProduct=parseInt(countProduct);
					totalCount += countProduct;
				}
				
			})
			totalCount = totalCount -1;
			$('#J_SelectedItemsCount').html('');
			$('#J_SelectedItemsCount').html(totalCount);

		}
		//算出总额
		function sum(){
			var totalprice1=0; 
			$('.item12').find('.J_ItemSum').each(function(){
				var priceSingel1=$(this).html();
				priceSingel1=parseFloat(priceSingel1);
				totalprice1 += priceSingel1;
			})
			$('#J_Total').html('');
			$('#J_Total').html(totalprice1.toFixed(2));
		}
		//初始化页面时算出总件数
		function count(){
			var totalCount1=0;
			$('.item12').find('.text_box').each(function(){
				var countProduct1=$(this).val();
				countProduct1=parseInt(countProduct1);
				totalCount1 += countProduct1;
				
			})
			$('#J_SelectedItemsCount').html('');
			$('#J_SelectedItemsCount').html(totalCount1);
		}
		//初始化页面时每种商品的总价
		function priceSingle(){
			$('.item12').find('.J_ItemSum').each(function(){
				var price=$(this).parents('.item12').find('.J_Price').html();
				var count=$(this).parents('.item12').find('.text_box').val();

				var priceSinTol=parseFloat(price)*parseInt(count);
				$(this).html('');
				$(this).html(priceSinTol.toFixed(2));

			})
			
		}
		priceSingle();
		//选上选项的时候变化变化数量总价格变动
		function selectTotalPrice(){
			var totalprice1=0; 
			$('.item12').find('.J_ItemSum').each(function(){
				if ($(this).closest('.item12').find('.check').prop('checked')) {					//判断是否选上，选上的话价格则相加
					var priceSingel1=$(this).html();
					priceSingel1=parseFloat(priceSingel1);
					totalprice1 += priceSingel1;
				}
			})
			$('#J_Total').html('');
			$('#J_Total').html(totalprice1.toFixed(2));
		}
		//选上选项的时候变化变化数量总数量变动
		function selectTotalCount(){
			var totalCount1=0;
			$('.item12').find('.text_box').each(function(){
				if ($(this).closest('.item12').find('.check').prop('checked')) {         	//判断是否选上，选上的话数量则相加
					var countProduct1=$(this).val();
					countProduct1=parseInt(countProduct1);
					totalCount1 += countProduct1;
				}
				
			})
			totalCount1=totalCount1+1
			$('#J_SelectedItemsCount').html('');
			$('#J_SelectedItemsCount').html(totalCount1);

		}
		function selectTotalCount1(){
			var totalCount1=0;
			$('.item12').find('.text_box').each(function(){
				if ($(this).closest('.item12').find('.check').prop('checked')) {         	//判断是否选上，选上的话数量则相加
					var countProduct1=$(this).val();
					countProduct1=parseInt(countProduct1);
					totalCount1 += countProduct1;
				}
				
			})
			totalCount1=totalCount1-1;
			
			$('#J_SelectedItemsCount').html('');
			$('#J_SelectedItemsCount').html(totalCount1);

		}
		//选择上的选项计算总额
		$('.item12').find('.check').click(function(){
			var totalprice1=0; 
			$('.item12').find('.J_ItemSum').each(function(){
				if ($(this).closest('.item12').find('.check').prop('checked')) {					//判断是否选上，选上的话价格则相加
					var priceSingel1=$(this).html();
					priceSingel1=parseFloat(priceSingel1);
					totalprice1 += priceSingel1;
				}
			})
			$('#J_Total').html('');
			$('#J_Total').html(totalprice1.toFixed(2));
		})
		//选择上的选项计算总数
		$('.item12').find('.check').click(function(){
			var totalCount1=0;
			$('.item12').find('.text_box').each(function(){
				if ($(this).closest('.item12').find('.check').prop('checked')) {         	//判断是否选上，选上的话数量则相加
					var countProduct1=$(this).val();
					countProduct1=parseInt(countProduct1);
					totalCount1 += countProduct1;
				}
				
			})
			$('#J_SelectedItemsCount').html('');
			$('#J_SelectedItemsCount').html(totalCount1);

		})
		//点击全选按钮的功能实现
		$('#J_SelectAllCbx2').click(function(){
			if ($('#J_SelectAllCbx2').prop('checked')) {
				$('.item12').find('.check').each(function(){
					$(this).prop('checked','checked');
				});
				count();
				sum();
			}else{
				$('.item12').find('.check').each(function(){
					$(this).prop('checked','');
				});
				$('#J_Total').html('0.00');
				$('#J_SelectedItemsCount').html('0');

			}
		})



		//删除后获取购物车的商品数据
		function deleteproduct(obj){
			$('#J_Total').html('0.00');
			$('#J_SelectedItemsCount').html('0');
			var id=$(obj).attr('alt');
			$.get('/Api/Index/gainShop',{'id':id},function(ret){
				
				if (ret.status==true) {
					var html=template('productpush',ret);
					$(".bundle-main").html("");
					$(".bundle-main").append(html);
				}else{
					$(".bundle-main").html("");
				}
				changecount();//重新加载JS
				priceSingle();	
				show.clickprice();
				show.clickcount();
			})
		}
		//选择后删除
		$('.deleteAll').click(function(){
			$('.item12').find('.check').each(function(){
				if ($(this).prop('checked')) {			//删除选中商品
					var id=$(this).closest('.item12').find('.delete').attr('alt');
					$.get('/Api/Index/gainShop',{'id':id},function(ret){});
				}
			})
			$.get('/Api/Index/gainShop',null,function(ret){
				$('#J_Total').html('0.00');
				$('#J_SelectedItemsCount').html('0');
				if (ret.status==true) {		
					var html=template('productpush',ret);
					$(".bundle-main").html("");
					$(".bundle-main").append(html);
					changecount();
					priceSingle();	
					show.clickprice();
					show.clickcount();
				}else{
					$(".bundle-main").html("");
				}
			})
		})



		//修改商品数量
		function changecount(){
			$(function(){
		         $(".add").click(function(){
		          var t=$(this).parent().find('input[class*=text_box]');
		         t.val(parseInt(t.val())+1)
		        })
		      $(".min").click(function(){
		       var t=$(this).parent().find('input[class*=text_box]');
		         t.val(parseInt(t.val())-1)
		         if(parseInt(t.val())<1){
		          t.val(1);
		          }
		       })
		  })
		}



		//结算
		$('#J_Go').click(function(){
			var idProduct=new Array();
			var b=false;
			$('.item12').find('.check').each(function(){
				if ($(this).prop('checked')) {
					var id=$(this).attr('alt');
					idProduct.push(id);
					b = true;
				}
			})
			if (b==true) {
				location.href='/Home/Pay/index?id='+idProduct;
				
			}else{
				alert('请选择购买的商品');
			}
		})

		</script>
	</body>

</html>